package com.ruoyi.fitsculpt.service.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.fitsculpt.mapper.EasyfitExerciseLogsMapper;
import com.ruoyi.fitsculpt.domain.EasyfitExerciseLogs;
import com.ruoyi.fitsculpt.service.IEasyfitExerciseLogsService;

/**
 * 运动打卡记录Service业务层处理
 *
 * @author metaee
 * @date 2025-02-27
 */
@Service
public class EasyfitExerciseLogsServiceImpl implements IEasyfitExerciseLogsService {
    @Autowired
    private EasyfitExerciseLogsMapper easyfitExerciseLogsMapper;

    /**
     * 查询运动打卡记录
     *
     * @param logId 运动打卡记录主键
     * @return 运动打卡记录
     */
    @Override
    public EasyfitExerciseLogs selectEasyfitExerciseLogsByLogId(Long logId) {
        return easyfitExerciseLogsMapper.selectEasyfitExerciseLogsByLogId(logId);
    }

    /**
     * 查询运动打卡记录列表
     *
     * @param easyfitExerciseLogs 运动打卡记录
     * @return 运动打卡记录
     */
    @Override
    public List<EasyfitExerciseLogs> selectEasyfitExerciseLogsList(EasyfitExerciseLogs easyfitExerciseLogs) {
        return easyfitExerciseLogsMapper.selectEasyfitExerciseLogsList(easyfitExerciseLogs);
    }

    /**
     * 新增运动打卡记录
     *
     * @param easyfitExerciseLogs 运动打卡记录
     * @return 结果
     */
    @Override
    public int insertEasyfitExerciseLogs(EasyfitExerciseLogs easyfitExerciseLogs) {
        easyfitExerciseLogs.setCreateTime(DateUtils.getNowDate());
        return easyfitExerciseLogsMapper.insertEasyfitExerciseLogs(easyfitExerciseLogs);
    }

    /**
     * 修改运动打卡记录
     *
     * @param easyfitExerciseLogs 运动打卡记录
     * @return 结果
     */
    @Override
    public int updateEasyfitExerciseLogs(EasyfitExerciseLogs easyfitExerciseLogs) {
        return easyfitExerciseLogsMapper.updateEasyfitExerciseLogs(easyfitExerciseLogs);
    }

    /**
     * 批量删除运动打卡记录
     *
     * @param logIds 需要删除的运动打卡记录主键
     * @return 结果
     */
    @Override
    public int deleteEasyfitExerciseLogsByLogIds(Long[] logIds) {
        return easyfitExerciseLogsMapper.deleteEasyfitExerciseLogsByLogIds(logIds);
    }

    /**
     * 删除运动打卡记录信息
     *
     * @param logId 运动打卡记录主键
     * @return 结果
     */
    @Override
    public int deleteEasyfitExerciseLogsByLogId(Long logId) {
        return easyfitExerciseLogsMapper.deleteEasyfitExerciseLogsByLogId(logId);
    }

    /**
     * 根据ID查询运动记录
     * 
     * @param id 运动记录ID
     * @return 运动记录信息
     */
    @Override
    public EasyfitExerciseLogs selectEasyfitExerciseLogsById(Long id) {
        return easyfitExerciseLogsMapper.selectEasyfitExerciseLogsById(id);
    }
}
